const db = require("../../database")
exports.getUserInfo = (req, res) => {
    const id = ((req || {}).auth).data.id;
    const sql = `select * from users where id = ?`;
    db.query(sql, [id], (err,results) => {
        if(err){
            return res.send({
                status: 0,
                msg: err.message,
                success: false,
            })
        }
        if(!results.length){
            return res.send({
                status: 0,
                msg: "获取用户信息失败",
                success: false,
            })
        } else {
            return res.send({
                status: 1,
                msg: "获取用户信息成功",
                success: true,
            })
        }
    })
    
}